namespace GemBox.Spreadsheet
{
    using System;
    using System.ComponentModel;
    using System.Drawing;

    public abstract class AbstractRange
    {
        private ExcelWorksheet parent;

        [EditorBrowsable(EditorBrowsableState.Never)]
        protected AbstractRange(ExcelWorksheet parent)
        {
            this.parent = parent;
        }

        internal void CheckMultiline(object val)
        {
            string str = val as string;
            if ((str != null) && (str.IndexOf('\n') != -1))
            {
                this.Style.WrapText = true;
            }
        }

        public abstract void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle);

        public abstract ExcelComment Comment { get; set; }

        public abstract string Formula { get; set; }

        public abstract bool IsStyleDefault { get; }

        internal ExcelWorksheet Parent
        {
            get
            {
                return this.parent;
            }
        }

        public abstract CellStyle Style { get; set; }

        public abstract object Value { get; set; }
    }
}
